package com.fh.mappers;

import com.fh.entity.po.Brand;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * 描述:
 * Author:袁亚强
 * Date:2021/11/2415:30
 */
@Mapper
public interface BrandMapper {
    @Select("select * from t_shop_brand where isdel =0")
    List<Brand> queryAllBrandData();

    @Select("select * from t_shop_brand where id = #{id}")
    Brand queryById(Integer id);

    void updateBrand(Brand brand);

    @Insert("insert into t_shop_brand (name,img,brandDate,isdel,createDate) value(#{name},#{img},#{brandDate},#{isdel},#{createDate})")
    void addBrand(Brand brand);

    @Select("select * from t_shop_brand where name=#{name}")
    Brand queryByName(String name);
}
